#include <string>
class Solution {
public:
	/**
	* 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
	*
	*
	* @param param string字符串
	* @return string字符串
	*/
	string compressString(string param) {
		int left = 0, right = 1, sz = param.size();
		string ret;
		while (right < sz)
		{
			int cnt = 1;
			while (param[left] == param[right])
			{
				++cnt;
				++right;
			}
			ret += param[left];
			if (cnt != 1)
				ret += to_string(cnt);
				// ret += cnt + '0'; // !!!!!!!!!!!!
			left = right;
			++right;
		}
		if (left == sz - 1)
			ret += param[left];
		// cout << left << " " << right << " " << sz << endl;
		return ret;
	}
};